package com.yanqu.road.server.cmd.banquet.cross;

import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.banquet.CrossBanquetMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_BANQUET_CROSS_USER_LUCK, desc = "跨服私人宴会满座奖励发送")
public class SendLuckUserCmd extends AbstractCommand {

	private String banquetId;

	private long userId;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		CrossBanquetProto.SendCrossUserBanquetLuckUserMsg reqMsg = CrossBanquetProto.SendCrossUserBanquetLuckUserMsg.parseFrom(packet.getBytes());
		banquetId = reqMsg.getBanquetId();
		userId = reqMsg.getUserId();
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		CrossBanquetMgr.sendLuckUserReward(banquetId,userId);
	}

	@Override
	public void sendData(GamePlayer player) {

	}
}
